// Copyright (C) 2005 Taylor L. Riché <riche@cs.utexas.edu>
//  
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software 
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// 	$Id: prettyprint.cc 68 2005-08-02 15:17:06Z  $	
//

#include "prettyprint.hh"

std::ostream & 
operator<<(std::ostream & o, const tt::FiveTuple & ft)
{
  tt::IPAddress ipsrc(ft.saddr);
  tt::IPAddress ipdst(ft.daddr);
  return o << "\nIPSRC: " << ipsrc << " IPDST: " << ipdst
	   << "\nSRCPORT: " << ft.sport << " DSTPORT: " << ft.dport
	   << " PROTOCOL: " << ft.proto;
}

std::ostream & 
operator<<(std::ostream & o, const tt::IPAddress & ip)
{
  int A = (ip.getIR() & 0xFF000000) >> 24;
  int B = (ip.getIR() & 0x00FF0000) >> 16;
  int C = (ip.getIR() & 0x0000FF00) >> 8;
  int D = (ip.getIR() & 0x000000FF);
  return o << A << "." << B << "." << C << "." << D;
}


